<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<title>index</title>

		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<link rel="stylesheet" type="text/css" href="<%=path%>/js/ext/resources/css/ext-all.css"/>
			<script type="text/javascript" src="<%=path%>/js/ext/adapter/ext/ext-base.js"></script>
			<script type="text/javascript" src="<%=path%>/js/ext/ext-all.js"></script>
			<script type="text/javascript"src="<%=path%>/js/ext/build/locale/ext-lang-zh_CN.js"></script>
		<script type="text/javascript">
Ext.onReady(function(){
		 //	第一个下拉框
	var system = new Ext.data.Record.create( [ {
		name : 'systems_id',
		type : 'int'
	}, {
		name : 'systems_name',
		type : 'string'
	}, {
		name : 'systems_code',
		type : 'string'
	}, {
		name : 'systems_sysFlag',
		type : 'int'
	}, ])
	var systemsStore = new Ext.data.Store( {
		proxy : new Ext.data.HttpProxy( {
			url : '/schedule/querySystems'
		}),
		reader : new Ext.data.JsonReader( {
			totalProperty : 'totalProperty',
			root : 'root'
		}, system),
		remoteSort : true
	});
	systemsStore.load( {
		params : {
			start : 0,
			limit : 30
		}
		});
	
	
			var professional = new Ext.data.Record.create( [ {
				name : 'professional_id',
				type : 'int'
			}, {
				name : 'professional_systems.systems_name',
				type : 'string'
			}, {
				name : 'professional_systems.systems_id',
				type : 'int'
			}, {
				name : 'professional_code',
				type : 'string'
			}, {
				name : 'professional_name',
				type : 'string'
			}, {
				name : 'professional_sysFlag',
				type : 'int'
			}, ]);
			
			var professionalstore;
			function getData(val){
				var	url = "/schedule/queryProfessional?flag="+encodeURI(encodeURI(val));
				professionalstore= new Ext.data.Store({
						id:"professional_id",
						proxy:new Ext.data.HttpProxy({url:url}),
						reader:new Ext.data.JsonReader({
						totalProperty:'totalProperty',
						root:'root'
					},professional),
					remoteSort:true
					});
					if(val != undefined){
						grid.reconfigure(professionalstore, cols);
					}
					professionalstore.load({params:{start:0,limit:15}});
				};
					getData();
			
       
        
        var adminform= new Ext.form.FormPanel({
								region:'center',
								frame : true,
								width:600,
								height:400,
								layout : "form", // 整个大的表单是form布局
								labelWidth : 65,
								labelAlign : "right",
								renderTo:"div2",
								maximizable:true,
								items : [{ // 行1
									layout : "column", // 从左往右的布局
									items : [{
										columnWidth : .8,
										layout : "form",
										items : [{
										    	fieldLabel: '请选择分类',
									            xtype:'combo',
									            store: systemsStore,
									            valueField :"systems_id",
									            displayField: "systems_name",
									            mode: 'local',
									            forceSelection: true,//必须选择一项
									            emptyText:'请选择分类...',//默认值
									            hiddenName:'interviewsDetail.parent_category',//hiddenName才是提交到后台的input的name
									            editable: false,//不允许输入
									            triggerAction: 'all',//因为这个下拉是只能选择的，所以一定要设置属性triggerAction为all，不然当你选择了某个选项后，你的下拉将只会出现匹配选项值文本的选择项，其它选择项是不会再显示了，这样你就不能更改其它选项了。
									            //allowBlank:false,//该选项值不能为空
										   		id : 'parent_id',
									            name: 'parent',
												width: 400,
												listeners:{  
													select : function(combo, record,index){
														professionalstore.proxy= new Ext.data.HttpProxy({url: '/schedule/queryProfessional?professional_id=' + combo.value});
									 					professionalstore.load(); 
													}
												}
									        },{
									            xtype:'combo',
									            store: professionalstore,
									            valueField :"professional_id",
									            displayField: "professional_name",
										    //数据是在本地
									            mode: 'local',
									            forceSelection: true,//必须选择一项
									            emptyText:'请选择子分类...',//默认值
									            hiddenName:'interviewsDetail.child_category',//hiddenName才是提交到后台的input的name
									            editable: false,//不允许输入
									            triggerAction: 'all',//因为这个下拉是只能选择的，所以一定要设置属性triggerAction为all，不然当你选择了某个选项后，你的下拉将只会出现匹配选项值文本的选择项，其它选择项是不会再显示了，这样你就不能更改其它选项了。
									            //allowBlank:false,//该选项值不能为空
									            fieldLabel: '选择',
									            id : 'child_id',
									            name: 'child',
										    	width: 400
									        }]
									}]
								}]
							});
		 
        
	});

		</script>
	</head>
	<body>
	 <div id="div1"></div>
  <div id="div2"></div>
   <div id="div3"></div>
  <div id="div4"></div>
   <div id="tool"></div>
    <div id="div6"></div>
	<div id="t"></div>
	</body>
</html>
